package com.sls.game.dao.nutsnet.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sls.game.dao.impl.SuperDAO;
import com.sls.game.dao.nutsnet.ChargeTypeInfoDAO;
import com.sls.game.pojo.nutsnet.ChargeTypeInfo;

/**
 * 
 * @description
 * @author Wangxuegang
 * @date 2012-11-2
 * 
 */
@Repository("chargeTypeInfoDAO")
public class ChargeTypeInfoDAOImpl extends SuperDAO<ChargeTypeInfo> implements
		ChargeTypeInfoDAO {

	/**
	 * 数据插入
	 * 
	 * @param chargeTypeInfo
	 */
	@Override
	public void insert(ChargeTypeInfo chargeTypeInfo) {
		this.getSqlSession().insert(
				"mybatis.xml.NutsNetChargeTypeMapper.insert", chargeTypeInfo);

	}

	/**
	 * 记录查询
	 * 
	 * @param chargeTypeInfo
	 * @return
	 */
	@Override
	public String queryChargeType(ChargeTypeInfo chargeTypeInfo) {
		String hidChargeType = this.getSqlSession().selectOne(
				"mybatis.xml.NutsNetChargeTypeMapper.queryChargeType",
				chargeTypeInfo);

		return hidChargeType;
	}

	/**
	 * 通过goodsId,chargetypeName,buynumber_list查询一条记录
	 * 
	 * @param chargeTypeInfo
	 * @return
	 */
	@Override
	public List<ChargeTypeInfo> queryOneOrMoreChargeType(
			ChargeTypeInfo chargeTypeInfo) {
		List<ChargeTypeInfo> list = this.getSqlSession().selectList(
				"mybatis.xml.NutsNetChargeTypeMapper.queryOneOrMoreRecord",
				chargeTypeInfo);
		return list;
	}

	/**
	 * 根据商品编号，删除该商品记录
	 * 
	 * @param goodsId
	 */
	@Override
	public void deleteById(String id) {
		this.getSqlSession().delete(
				"mybatis.xml.NutsNetChargeTypeMapper.deleteById",id);
	}

}
